package com.ruoyi.project.jiaqin.intentionmessage.service.impl;

import java.util.List;
import java.util.UUID;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.jiaqin.intentionmessage.mapper.IntentionMessageMapper;
import com.ruoyi.project.jiaqin.intentionmessage.domain.IntentionMessage;
import com.ruoyi.project.jiaqin.intentionmessage.service.IIntentionMessageService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 意向留言Service业务层处理
 *
 * @author admin
 * @date 2021-01-05
 */
@Service
public class IntentionMessageServiceImpl implements IIntentionMessageService
{
    @Autowired
    private IntentionMessageMapper intentionMessageMapper;

    /**
     * 查询意向留言
     *
     * @param id 意向留言ID
     * @return 意向留言
     */
    @Override
    public IntentionMessage selectIntentionMessageById(String id)
    {
        return intentionMessageMapper.selectIntentionMessageById(id);
    }

    /**
     * 查询意向留言列表
     *
     * @param intentionMessage 意向留言
     * @return 意向留言
     */
    @Override
    public List<IntentionMessage> selectIntentionMessageList(IntentionMessage intentionMessage)
    {
        return intentionMessageMapper.selectIntentionMessageList(intentionMessage);
    }

    /**
     * 新增意向留言
     *
     * @param intentionMessage 意向留言
     * @return 结果
     */
    @Override
    public int insertIntentionMessage(IntentionMessage intentionMessage)
    {
        intentionMessage.setId(UUID.randomUUID().toString().replace("-",""));
        return intentionMessageMapper.insertIntentionMessage(intentionMessage);
    }

    /**
     * 修改意向留言
     *
     * @param intentionMessage 意向留言
     * @return 结果
     */
    @Override
    public int updateIntentionMessage(IntentionMessage intentionMessage)
    {
        return intentionMessageMapper.updateIntentionMessage(intentionMessage);
    }

    /**
     * 删除意向留言对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteIntentionMessageByIds(String ids)
    {
        return intentionMessageMapper.deleteIntentionMessageByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除意向留言信息
     *
     * @param id 意向留言ID
     * @return 结果
     */
    @Override
    public int deleteIntentionMessageById(String id)
    {
        return intentionMessageMapper.deleteIntentionMessageById(id);
    }
}
